"""cronmanger URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin

from user_account.views import (user_login_view_class, user_register_view_class, logout_fun)
from django.views.generic import TemplateView

from supervisor_dj.views_v2 import action, supervisor_hostlist_class_view as     supervisor_hostlist_class_view_v2, \
    get_process_info_detail_view, refresh_allhost_allprocess, refresh_host_all_process, supervisor_hostlist_class_view, \
    Add_Supervisor_Host_View
from .view import IndexView

urlpatterns = [
    url(r'^admin/', admin.site.urls),

    url(r'^login/$', user_login_view_class.as_view(), name='user_login'),
    url(r'^register/$', user_register_view_class.as_view(), name='user_register'),
    url(r'^logout/$', logout_fun, name='user_logout'),

    url(r'^index/$', IndexView.as_view(), name='index'),
    url(r'^$', IndexView.as_view(), name='index'),

    url(r'^supervisor/list$', supervisor_hostlist_class_view_v2.as_view(), name='supervisor_list'),
    url(r'^supervisor/action/$', action, name='supervisor_start_stop_restart'),
    url(r'^supervisor/detail1/$', get_process_info_detail_view, name='supervisor_detail1'),

    url(r'^supervisor/add_host/$', Add_Supervisor_Host_View.as_view(), name='supervisor_addhost'),
    url(r'^supervisor/refresh/$', refresh_host_all_process, name='supervisor_refreshhost'),
    url(r'^supervisor/refresh_allhost_process/$', refresh_allhost_allprocess,
        name='supervisor_refresh_allhost_allprocess'),

]
